{include file="common@public/_category" /}
<!--container-->
  <div class="container container-gary">
      <!-- member index -->
      <div class="m-ptb wrap clearfix">
          {include file="common@public/_personal_left"}
          <div class="member-right">
              <div class="member-sign clearfix"><b>库存查询</b></div>
              <div class="member-order min-height">
                  <form id="form" action="{:url('stockquery')}" method="GET">
                    <div class="m-order-enter add-new-style clearfix">
                        <div class="m-order-left">
                            <div class="m-order-item">
                                <div class="m-order-text">仓库：</div>
                                <div class="m-order-write">
                                    <select class="m-o-select store-w1" name="warehouseid">
                                        <option value="">请选择仓库</option>
                                        {volist name="warehousedata" id="vo"}
                                            <option value="{$vo.warehouseid}" {eq name='Think.get.warehouseid' value='$vo.warehouseid'} selected {/eq}>{$vo.warehousename}</option>
                                        {/volist}
                                    </select>
                                </div>
                            </div>
                            <div class="m-order-item">
                                <div class="m-order-text">款号：</div>
                                <div class="m-order-write">
                                    <select class="m-o-select store-w1" name="artno">
                                        <option value="">请选择款号</option>
                                        {volist name="typedata" id="vo"}
                                            <option value="{$vo.classid}" {eq name='Think.get.artno' value='$vo.classid'} selected {/eq}>{$vo.artno}</option>
                                        {/volist}
                                    </select>
                                </div>
                            </div>
                            <div class="m-order-item">
                                <div class="m-order-text">店铺：</div>
                                <div class="m-order-write">
                                    <select class="m-o-select store-w1" name="shopid">
                                        <option value="">请选择店铺</option>
                                        {volist name="shopdata" id="vo"}
                                            <option value="{$vo.id}" {eq name='Think.get.shopid' value='$vo.id'} selected {/eq}>{$vo.name}</option>
                                        {/volist}
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="m-order-right">
                            <input class="m-btn-color" type="submit" value="查询" />
                        </div>
                    </div>
                  </form>
                  <div class="address-manage">
                      <div class="member-thead clearfix">
                          <div class="check-color">颜色</div>
                          {volist name="sizedata" id="vo"}
                              <div class="check-xs">{$vo.name}</div>
                          {/volist}
                          <div class="check-buy">购买</div>
                      </div>
                      {volist name="colordata" id="vo"}
                        <div class="address-item check-item">
                            <div class="add-i-total check-color">{$vo.name}</div>
                            {volist name="vo['stockdata']" id="v"}
                                <div class="add-i-total check-xs">{$v.num}</div>
                            {/volist}
                            <div class="add-i-total check-buy"><a class="check-b-a" {notempty name="v['skuid']"} href="{:url('goods/product/goods_detail',['skuid'=>$v['skuid']])}" {else /}href="javascript:;"{/notempty}></a></div>
                        </div>
                      {/volist}
                  </div>
                  

              </div>
              
          </div>
      </div>

  </div>

  <!-- footer -->
  <!--#include file="includes/foot.html"-->

<!-- check -->
<script src="/public/static/home/js/icheck.js"></script>
<!-- menu -->
<script type="text/javascript" src="/public/static/home/js/menu.js"></script>
<script>
    $(function(){
      //top select
      $(".top-select").mouseover(function () {
        $(".top-s-text").show();
      })
      $(".top-select").mouseout(function () {
        $(".top-s-text").hide();
      })
      $(".top-s-text div").click(function () {
        var selecttext = $(this).text();
        $(".top-s-head span").text(selecttext);
        $(this).parent(".top-s-text").hide()
      })
      // top code
      var turn = function(target,time,opts){
      target.find('.top-code').hover(function () {
            $(this).find('.top-c-img').stop().animate(opts[0], time, function () {
			$(this).hide().next().show();
			$(this).next().animate(opts[1],time);
	   });
	   },function(){
	        $(this).find('.top-c-text').animate(opts[0], time, function () {
			    $(this).hide().prev().show();
			    $(this).prev().animate(opts[1],time);
		 });
	     });
        }
        var verticalOpts = [{'width':0},{'width':'80px'}];
        turn($('.top-right'), 150, verticalOpts);
        //menu all
        $(".menu-all div").mouseenter(function () {
            $(this).addClass("current");
            $(".submenu").show();
        })
       $(".menu-all div").mouseleave(function () {
            $(this).removeClass("current");
            $(".submenu").hide();
        })
        $(".submenu").mouseenter(function(){
           $(this).show();
           $(".menu-all div").addClass("current")
        })
        $(".submenu").mouseleave(function(){
           $(this).hide();
           $(".menu-all div").removeClass("current")
        })
        //left submenu
        $(".submenu ul li").each(function () {
            var $this = $(this);
            var $children = $this.find('.submenu-pro');
            var $otherChildren = $this.siblings('li').find('.submenu-pro');
            var $childrenList = $children.children('.submenu-total');
            $this.on({
                'mouseenter': function () {
                    $children.css({ 'display': 'block', 'width': 221 * parseInt($childrenList.size()) });
                    $otherChildren.css('display', 'none');
                },
                'mouseleave': function () {
                    $children.css('display', 'none');
                }
            })
        });
         //input
        $(document).ready(function () {
            var callbacks_list = $('.demo-callbacks ul');
            $('.demo-list input,.sign-in-enter input').on('ifCreated ifClicked ifChanged ifChecked ifUnchecked ifDisabled ifEnabled ifDestroyed', function (event) {
                callbacks_list.prepend('<li><span>#' + this.id + '</span> is ' + event.type.replace('if', '').toLowerCase() + '</li>');
            }).iCheck({
                checkboxClass: 'icheckbox_square-blue',
                radioClass: 'iradio_square-blue',
                increaseArea: '20%'
            });
        });

        //member left
        $(".member-l-title").click(function(){
           $(this).parent(".member-l-list").toggleClass("m-current");
           $(this).parent(".member-l-list").find("ul").slideToggle()
        })
        //content height
        $(".member-left").height($(".member-right").height())
        $("#form").submit(function(){
            var warehouseid=$("select[name='warehouseid'] option:selected").val();
            var artno=$("select[name='artno'] option:selected").val();
            var shopid=$("select[name='shopid'] option:selected").val();
            if(warehouseid==''){
                alert("请选择仓库");
                return false;
            }else if(artno==''){
                alert("请选择款号");
                return false;
            }else if(shopid==''){
                alert("请选择店铺");
                return false;
            }else{
                return true;
            }
        })
    })
</script>